package com.nowcode.community.mapper;

import com.nowcode.community.entity.DiscussPost;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * ClassName: DiscussPostMapper
 * Package: com.nowcode.community.mapper
 * Description:
 *
 * @Author: 信
 * @Create: 2024/1/20 - 19:43
 */
@Mapper
public interface DiscussPostMapper {

    List<DiscussPost> selectDiscussPosts(int userId, int offset, int limit);

    //TODO 4、@Param 注解用于给参数取别名，只有一个参数必须加？  我这里没加也可以呢
    int selectDiscussPostRows(int userId);

    int insertDiscussPost(DiscussPost discussPost);

    DiscussPost selectDiscussPostById(int id);

    int updateCommentCount(int id, int commentCount);

}
